package com.sun.java8.stream;

import org.junit.Test;

import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.util.*;

public class Test01 {
    /**
     *
     */
    @Test
    public void test1(){
        List<String> list = Arrays.asList("1", "11", "2", "3");
        list.stream().forEach(System.out::println);
    }

    @Test
    public void test2(){
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        HashMap<String, Object> map = new HashMap<>();
        map.put("a1",new Date());
        Arrays.asList(map,map,map).stream()
                .map(s->sdf.format(s.get("a1")))
                .distinct()
                .forEach(System.out::println);
    }
}
